import request from '@/utils/request';
import type { getDetailData } from './types';

/**
* @author: 马赛飞
* @Description: 获取详情页头部和内容数据
* @param: 
*/

export const  getDetailTopData = (id : number) => {
  return request.get<any,getDetailData>(`m-revision/page/album/v2/queryAlbumPage/${id}`);
}

/**
* @author: 马赛飞
* @Description: 获取节目列表的数据
* @param: 
*/
export const  getDetailProgramData = (params : any) => {
  return request.get<any,getDetailData>(`https://m.ximalaya.com/m-revision/common/album/queryAlbumTrackRecordsByPage?albumId=${params.AlbumId}&page=${params.page}&pageSize=${params.pageSize}&asc=${params.asc}&countKeys=play%2Ccomment&v=${params.v}`,{params});
}

/**
* @author: 马赛飞
* @Description: 获取主播信息的数据
* @param: 
*/
export const  getDetailAnchorData = (id : number) => {
  return request.get<any,getDetailData>(`https://m.ximalaya.com/m-revision/common/user/queryUserInfo/${id}?userCountKeys=follower`);
}

/**
* @author: 马赛飞
* @Description: 获取主播作品的数据
* @param: 
*/
export const  getDetailAnchorProgramData = (params : any) => {
  return request.get<any,getDetailData>(`https://m.ximalaya.com/m-revision/common/anchor/queryAnchorAlbumsByPage?anchorId=${params.anchorId}&page=${params.page}&pageSize=${params.pageSize}&asc=${params.asc}`,{params});
}

/**
* @author: 马赛飞
* @Description: 获取用户评论的数据
* @param: 
*/
export const  getDetailCommentData = (params : any) => {
 return request.get<any,getDetailData>(`https://m.ximalaya.com/m-revision/common/album/queryAlbumCommentsByPage?page=${params.page}&pageSize=${params.pageSize}&albumId=${params.albumId}&v=${params.v}`,{params});
}